//路由器鉴权
import router from  '@/router'
import nprogress from 'nprogress'
import 'nprogress/nprogress.css'
//获取仓库
import useUserStore from './store/modules/user';
import pinia from './store';
import { ELocalStorageKey} from '@/types/enums'

let useStore = useUserStore(pinia) ;

router.beforeEach((to :any, from: any,next:any)=>{
    nprogress.start();
    // if(to.path == '/login'){
        next()
    // }
    // if(!localStorage.getItem(ELocalStorageKey.Token))
    // {
    //     next({path:'/login', query: {redirect:to.path}})

    // }
    
    
})
router.afterEach((to :any, from: any)=>{
        nprogress.done();
})